export default {
  // Global page headers (https://go.nuxtjs.dev/config-head)
  head: {
    title: "freshmall-app",
    meta: [
      { charset: "utf-8" },
      { name: "viewport", content: "width=device-width, initial-scale=1.0, user-scalable=no,maximum-scale=1.0,minimum-scale=1.0" },
      { name: 'applicable-device', content: 'pc,mobile' },
      { hid: "description", name: "description", content: "" }
    ],
    link: [{ rel: "icon", type: "image/x-icon", href: "/favicon.ico" }]
  },

  // Global CSS (https://go.nuxtjs.dev/config-css)
  css: [
    "element-ui/lib/theme-chalk/index.css",
    "element-ui/lib/theme-chalk/reset.css",
    "~assets/css/main.css"
  ],

  // Plugins to run before rendering page (https://go.nuxtjs.dev/config-plugins)
  plugins: ['@/plugins/element-ui', '@/plugins/route', {src: '@/plugins/filter', ssr: true}],

  // Auto import components (https://go.nuxtjs.dev/config-components)
  components: true,

  // Modules for dev and build (recommended) (https://go.nuxtjs.dev/config-modules)
  buildModules: [],

  // Modules (https://go.nuxtjs.dev/config-modules)
  modules: ["@nuxtjs/axios", "@nuxtjs/proxy", "@gauseen/nuxt-proxy"],
  // axios: {
  //   // See https://github.com/nuxt-community/axios-module#options
  //   baseURL: "http://localhost:8085/"
  // },
  axios: {
    proxy: true // 表示开启代理
    // prefix: '/api', // 表示给请求url加个前缀 /api
    // credentials: true // 表示跨域请求时是否需要使用凭证
  },
  // proxy: {
  //   '/api': {
  //     target: 'http://172.20.10.7:3000', // 目标接口域名
  //     changeOrigin: true, // 表示是否跨域
  //     pathRewrite: {
  //       '^/api': '', // 把 /api 替换成 /
  //     }
  //   }
  // },
  // proxy: {
  //   "/api": {
  //     target: "http://localhost:3000",
  //     changeOrigin: true, // 表示是否跨域
  //     pathRewrite: {
  //       "^/api": "" // 把 /api 替换成 /
  //     }
  //   }
  // },
  proxyTable: {
    //腾讯地图接口
    "/api": {
      target: "https://apis.map.qq.com",
      ws: false,
      pathRewrite: {
        "^/api": "" // 把 /api 替换成 /
      }
    },
    //es商品搜索服务接口
    "/es": {
      target: "http://127.0.0.1:8081",
      changeOrigin: true,
      ws: false,
      pathRewrite: {
        "^/es": "" // 把 /es 替换成 /
      }
    }
  },

  // Build Configuration (https://go.nuxtjs.dev/config-build)
  build: {
    transpile: [/^element-ui/],
    cache: false
  },
  ssr:false
};
